<?php
/**
* @version		$Id:products.php  1 2013-10-12 13:59:21Z  $
* @package		Cashbag
* @subpackage 	Tables
* @copyright	Copyright (C) 2013, . All rights reserved.
* @license #
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

/**
* Jimtawl TableProducts class
*
* @package		Cashbag
* @subpackage	Tables
*/
class TableProducts extends JTable
{
	
   /** @var int virtuemart_product_id- Primary Key  **/
   public $virtuemart_product_id = null;
   
   /** @var varchar product_params  **/
   public $product_params = null;

   /** @var tinyint published  **/
   public $published = 1;

   /** @var int created_by  **/
   public $created_by = null;

   /** @var int modified_by  **/
   public $modified_by = null;

   /** @var smallint unsigned virtuemart_vendor_id  **/
   public $virtuemart_vendor_id = "1";

   /** @var int unsigned product_parent_id  **/
   public $product_parent_id = null;

   /** @var cashbagcashbag cashbag_id  **/
   public $cashbag_id = null;
   
   public $product_marque = null;
   
   public $product_couleur = null;
   
   public $product_matiere = null;
   /** @var char product_sku  **/
   public $product_sku = null;
   
   var $product_name	= '';
   /** @var decimal product_weight  **/
   public $product_weight = null;

   /** @var char product_weight_uom  **/
   public $product_weight_uom = null;

   /** @var decimal product_length  **/
   public $product_length = null;

   /** @var decimal product_width  **/
   public $product_width = null;

   /** @var decimal product_height  **/
   public $product_height = null;

   /** @var char product_lwh_uom  **/
   public $product_lwh_uom = null;

   /** @var char product_url  **/
   public $product_url = null;

   /** @var int product_in_stock  **/
   public $product_in_stock = null;

   /** @var int product_ordered  **/
   public $product_ordered = null;

   /** @var int unsigned low_stock_notification  **/
   public $low_stock_notification = null;

   /** @var datetime product_available_date  **/
   public $product_available_date = "0000-00-00 00:00:00";

   /** @var char product_availability  **/
   public $product_availability = null;

   /** @var tinyint product_special  **/
   public $product_special = null;

   /** @var int unsigned product_sales  **/
   public $product_sales = null;

   /** @var char product_unit  **/
   public $product_unit = null;

   /** @var decimal unsigned product_packaging  **/
   public $product_packaging = null;

   /** @var int unsigned hits  **/
   public $hits = null;

   /** @var varchar intnotes  **/
   public $intnotes = null;

   /** @var varchar metarobot  **/
   public $metarobot = null;

   /** @var varchar metaauthor  **/
   public $metaauthor = null;

   /** @var char layout  **/
   public $layout = null;

   /** @var mediumint unsigned pordering  **/
   public $pordering = null;

   /** @var datetime created_on  **/
   public $created_on = "0000-00-00 00:00:00";

   /** @var datetime modified_on  **/
   public $modified_on = "0000-00-00 00:00:00";

   /** @var datetime locked_on  **/
   public $locked_on = "0000-00-00 00:00:00";

   /** @var int locked_by  **/
   public $locked_by = null;
   
 




	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 * @since 1.0
	 */
	public function __construct(& $db) 
	{
		parent::__construct('#__virtuemart_products', 'virtuemart_product_id', $db);
	}

	/**
	* Overloaded bind function
	*
	* @acces public
	* @param array $hash named array
	* @return null|string	null is operation was satisfactory, otherwise returns an error
	* @see JTable:bind
	* @since 1.5
	*/
	public function bind($array, $ignore = '')
	{ 
		
		return parent::bind($array, $ignore);		
	}

	/**
	 * Overloaded check method to ensure data integrity
	 *
	 * @access public
	 * @return boolean True on success
	 * @since 1.0
	 */
	public function check()
	{



		/** check for valid name */
		/**
		if (trim($this->product_params) == '') {
			$this->setError(JText::_('Your Products must contain a product_params.')); 
			return false;
		}
		**/		

		return true;
	}
}
